define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'editable'], function ($, undefined, Backend, Table, Form, undefined) {

    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'dahui/qiyegongzi/index',
                    add_url: 'dahui/qiyegongzi/add',
                    edit_url: 'dahui/qiyegongzi/edit',
                    del_url: 'dahui/qiyegongzi/del',
                    multi_url: 'dahui/qiyegongzi/multi',
                    import_url: 'dahui/qiyegongzi/import',
                    table: 'dahui_qiyegongzi',
                }
            });

            var table = $("#table");

            //给添加按钮添加`data-area`属性
            $(".btn-add").data("area", ["100%", "100%"]);
            //当内容渲染完成给编辑按钮添加`data-area`属性
            table.on('post-body.bs.table', function (e, settings, json, xhr) {
                $(".btn-editone").data("area", ["100%", "100%"]);
            });

            //当表格数据加载完成时
            table.on('load-success.bs.table', function (e, data) {
                $("#money").text(data.extend.money);
            });

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                showToggle: false,
                search: false,
                sortName: 'id',
                dblClickToEdit: false, //是否启用双击编辑
                searchFormVisible: true,
                exportTypes: ['csv'],
                columns: [
                    [
                        {checkbox: true},
                        //{field: 'id', title: __('Id'), operate: false, sortable: true},
                        {field: 'caozyear', title: __('Caozyear'), addclass:'datetimepicker', formatter: Table.api.formatter.search},
                        {field: 'payyear', title: __('Payyear'), defaultValue: Controller.api.defaultdate(), addclass:'datetimepicker', formatter: Table.api.formatter.search},
                        {field: 'ownedcompany', title: __('Ownedcompany'), operate: 'LIKE %...%', placeholder: '模糊搜索，*表示任意字符', formatter: Table.api.formatter.search, sortable: true},
                        {field: 'idnumber', title: __('身份证号*'), operate: 'LIKE %...%', placeholder: '模糊搜索，*表示任意字符', formatter: Controller.api.formatter.idnumber},
                        {field: 'qiyekehu.name', title: __('Qiyekehu.name'), operate: false, formatter: Table.api.formatter.search, sortable: true},
                        {field: 'qiyekehu.mobile', title: __('Qiyekehu.mobile'), operate: false, formatter: Table.api.formatter.search, sortable: true},
                        {field: 'qiyekehu.bankcardnumber', title: __('Qiyekehu.bankcardnumber'), operate: 'LIKE %...%', placeholder: '模糊搜索，*表示任意字符', formatter: Table.api.formatter.search, sortable: true},
                        {field: 'sbbase', title: __('Sbbase'),  operate: false},
                        {field: 'gjjbase', title: __('Gjjbase'),  operate: false},
                        {field: 'basewages', title: __('Basewages'),  operate: false},
                        {field: 'bonuses', title: __('Bonuses'),  operate: false},
                        {field: 'allowance', title: __('Allowance'),  operate: false},
                        {field: 'overtimepay', title: __('Overtimepay'),  operate: false},
                        {field: 'deductions', title: __('Deductions'),  operate: false},
                        {field: 'totalwages', title: __('Totalwages'),  operate: false},
                        {field: 'd_pension', title: __('D_pension'),  operate: false},
                        {field: 'd_yiliao', title: __('D_yiliao'),  operate: false},
                        {field: 'd_shiye', title: __('D_shiye'),  operate: false},
                        {field: 'd_shengyu', title: __('D_shengyu'),  operate: false},
                        {field: 'd_gongshang', title: __('D_gongshang'),  operate: false},
                        {field: 'd_chanbao', title: __('D_chanbao'),  operate: false},
                        {field: 'd_gjj', title: __('D_gjj'),  operate: false},
                        {field: 'd_heji', title: __('D_heji'),  operate: false},
                        {field: 's_pension', title: __('S_pension'),  operate: false},
                        {field: 's_yiliao', title: __('S_yiliao'),  operate: false},
                        {field: 's_shiye', title: __('S_shiye'),  operate: false},
                        {field: 's_gjj', title: __('S_gjj'),  operate: false},
                        {field: 's_heji', title: __('S_heji'),  operate: false},
                        {field: 'y_wages', title: __('Y_wages'),  operate: false},
                        {field: 'zxkc', title: __('Zxkc'), operate:false},
                        {field: 'tax', title: __('Tax'),  operate: false},
                        {field: 'r_wages1', title: __('R_wages1'),  operate: false},
                        {field: 'subsidies', title: __('Subsidies'),  operate: false},
                        {field: 'withholding', title: __('Withholding'),  operate: false},
                        {field: 'r_wages2', title: __('R_wages2'),  operate: false},
                        {field: 'year_end_award', title: __('Year_end_award'),  operate: false},
                        {field: 'year_end_award_tax', title: __('Year_end_award_tax'),  operate: false},
                        {field: 'year_end_award_real', title: __('Year_end_award_real'),  operate: false},
                        {field: 'compensation', title: __('Compensation'),  operate: false},
                        {field: 'compensation_tax', title: __('Compensation_tax'),  operate: false},
                        {field: 'compensation_real', title: __('Compensation_real'),  operate: false},
                        {field: 'totalamount_z', title: __('Totalamount_z'),  operate: false},
                        {field: 'ffyh', title: __('Ffyh'),  operate: false},
                        {
                            field: 'paynote',
                            title: __('代缴备注*'),
                            editable: {
                                rows:10,
                                tpl: "<textarea rows='10' cols='50'></textarea>",
                                emptytext: '无',
                                disabled: !Config.caozuo , //true 则不能编辑 ---- 操作权限
                                success: function (response, newValue) {
                                    //$(".btn-refresh").trigger("click");
                                }
                            },
                            operate: false,
                        },
                        {field: 'paystatus', title: __('Paystatus'), searchList: {"已办理":__('已办理'),"未办理":__('未办理')}, formatter: Controller.api.formatter.djstatus, sortable: true},
                        //{field: 'luruman', title: __('录入员'), operate: false, sortable: true},
                        //{field: 'auditman', title: __('审核员'), operate: false, sortable: true},
                        {field: 'opman', title: __('操作员'), operate: false, sortable: true},
                        {field: 'update_time', title: __('Update_time'), operate:false, formatter: Table.api.formatter.datetime, sortable: true},
                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                    ]
                ]
            });

            var yearpayment = Controller.api.defaultdate();

            //在普通搜索提交搜索前
            table.on('common-search.bs.table', function (event, table, query) {
                //这里可以获取到普通搜索表单中字段的查询条件
                yearpayment = query.filter['payyear'];
            });

            //点击身份证
            $(document).on("dblclick", ".aidnumber[data-id]", function () {
                var url = 'dahui/qiyegongzi/index1?idnumber=' + $(this).data('id');
                var options = {
                    shadeClose: false,
                    shade: [0.3, '#393D49'],
                    area: ["100%", "100%"],
                    callback:function(data){

                    }
                };
                Fast.api.open(url, "工资代缴明细", options);
            });

            //点击代缴状态
            $(document).on("dblclick", ".djstatus[data-id]", function () {
                if (Config.caozuo ) {
                    var url = 'dahui/qiyegongzi/changetstatus';
                    var id = $(this).data('id');
                    var _this = $(this);
                    Fast.api.ajax({
                        url: url,
                        data: {ids: id},
                    }, function (data, ret) {
                        //table.bootstrapTable('refresh');
                        console.log(ret.data.paystatus);
                        _this.html(ret.data.paystatus);
                        if (ret.data.paystatus != '未办理') {
                            _this.removeClass('text-danger')
                        }  else {
                            _this.addClass('text-danger');
                        }
                    });
                }
            });

            // 批量办理状态
            $(document).on("click", ".plblzt", function () {
                var ids = Table.api.selectedids(table);
                var url = 'dahui/qiyegongzi/changetstatuspl?ids=' + ids;

                var that = this;
                Layer.confirm(__('确定批量办理状态?'), {
                    btn: ['未办理','已办理'],
                    btn3: function (index, layero) {
                        console.log(3);
                        Backend.api.ajax({
                            url: url+'&type=2',
                        }, function () {
                            Layer.close(index);
                            $(".btn-refresh").trigger("click");
                        });
                    }
                }, function (index) {
                    Backend.api.ajax({
                        url: url+'&type=0',
                    }, function () {
                        Layer.close(index);
                        $(".btn-refresh").trigger("click");
                    });
                }, function (index) {
                    Backend.api.ajax({
                        url: url+'&type=1',
                    }, function () {
                        Layer.close(index);
                        $(".btn-refresh").trigger("click");
                    });
                });

            });

            // 批量转入下月
            $(document).on("click", ".plzxy", function () {
                if (Config.caozuo ) {
                    var that = this;
                    var yearpayment2 = Controller.api.nextmonth(new Date(yearpayment));

                    Layer.confirm('确定批量将' + yearpayment + '月客户转入' + yearpayment2 + '月？', function () {
                        var url = 'dahui/qiyegongzi/zrxy?yearpayment=' + yearpayment;
                        Fast.api.ajax(url, function () {
                            Layer.closeAll();
                            table.bootstrapTable('refresh');
                        }, function () {
                            Layer.closeAll();
                        });
                    });
                }

                return false;
            });

            var form = $("form.form-commonsearch");
            if ($(".datetimepicker", form).size() > 0) {
                require(['bootstrap-datetimepicker'], function () {
                    var options = {
                        format: 'YYYY-MM',
                        icons: {
                            time: 'fa fa-clock-o',
                            date: 'fa fa-calendar',
                            up: 'fa fa-chevron-up',
                            down: 'fa fa-chevron-down',
                            previous: 'fa fa-chevron-left',
                            next: 'fa fa-chevron-right',
                            today: 'fa fa-history',
                            clear: 'fa fa-trash',
                            close: 'fa fa-remove'
                        },
                        showTodayButton: true,
                        showClose: true
                    };
                    $('.datetimepicker', form).parent().css('position', 'relative');
                    $('.datetimepicker', form).datetimepicker(options);
                });
            }

            // 为表格绑定事件
            Table.api.bindevent(table);
        },
        index1: function () {
            // 初始化表格参数配置
            var idnumber =  $("#idnumber").val();

            Controller.api.bindevent();

            Table.api.init({
                extend: {
                    index_url: 'dahui/qiyegongzi/index1list?idnumber='+idnumber,
                    add_url: '',
                    edit_url: '',
                    del_url: '',
                    multi_url: '',
                    table: 'dahui_qiyegongzi',
                }
            });

            console.log('' + $.fn.bootstrapTable.defaults.extend.index_url);

            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                search:false,
                showToggle: false,
                showColumns: false,
                commonSearch: false,
                exportTypes: ['csv'],
                dblClickToEdit: false, //是否启用双击编辑
                searchFormVisible: true,
                columns: [
                    [
                        {field: 'payyear', title: __('Payyear'), operate: false},
                        {field: 'ownedcompany', title: __('Ownedcompany'), operate: false},
                        {field: 'sbbase', title: __('Sbbase'),  operate: false},
                        {field: 'gjjbase', title: __('Gjjbase'),  operate: false},
                        {field: 'basewages', title: __('Basewages'),  operate: false},
                        {field: 'bonuses', title: __('Bonuses'),  operate: false},
                        {field: 'allowance', title: __('Allowance'),  operate: false},
                        {field: 'overtimepay', title: __('Overtimepay'),  operate: false},
                        {field: 'deductions', title: __('Deductions'),  operate: false},
                        {field: 'totalwages', title: __('Totalwages'),  operate: false},
                        {field: 'd_pension', title: __('D_pension'),  operate: false},
                        {field: 'd_yiliao', title: __('D_yiliao'),  operate: false},
                        {field: 'd_shiye', title: __('D_shiye'),  operate: false},
                        {field: 'd_shengyu', title: __('D_shengyu'),  operate: false},
                        {field: 'd_gongshang', title: __('D_gongshang'),  operate: false},
                        {field: 'd_chanbao', title: __('D_chanbao'),  operate: false},
                        {field: 'd_gjj', title: __('D_gjj'),  operate: false},
                        {field: 'd_heji', title: __('D_heji'),  operate: false},
                        {field: 's_pension', title: __('S_pension'),  operate: false},
                        {field: 's_yiliao', title: __('S_yiliao'),  operate: false},
                        {field: 's_shiye', title: __('S_shiye'),  operate: false},
                        {field: 's_gjj', title: __('S_gjj'),  operate: false},
                        {field: 's_heji', title: __('S_heji'),  operate: false},
                        {field: 'y_wages', title: __('Y_wages'),  operate: false},
                        {field: 'tax', title: __('Tax'),  operate: false},
                        {field: 'r_wages1', title: __('R_wages1'),  operate: false},
                        {field: 'subsidies', title: __('Subsidies'),  operate: false},
                        {field: 'withholding', title: __('Withholding'),  operate: false},
                        {field: 'r_wages2', title: __('R_wages2'),  operate: false},
                        {field: 'managementfee', title: __('Managementfee'),  operate: false},
                        {field: 'totalamount', title: __('Totalamount'),  operate: false},
                        {field: 'year_end_award', title: __('Year_end_award'),  operate: false},
                        {field: 'year_end_award_tax', title: __('Year_end_award_tax'),  operate: false},
                        {field: 'year_end_award_real', title: __('Year_end_award_real'),  operate: false},
                        {field: 'compensation', title: __('Compensation'),  operate: false},
                        {field: 'compensation_tax', title: __('Compensation_tax'),  operate: false},
                        {field: 'compensation_real', title: __('Compensation_real'),  operate: false},
                        {field: 'totalamount_z', title: __('Totalamount_z'),  operate: false},
                        {field: 'paynote', title: __('Paynote'), operate: false},
                        {field: 'paystatus', title: __('Paystatus'), operate: false},
                    ]
                ]
            });

            // 为表格绑定事件
            Table.api.bindevent(table);

        },
        add: function () {

            Controller.api.valuechanged();

            $(document).on("change", ".valuechanged", function () {
                Controller.api.valuechanged();
            });

            Controller.api.bindevent();

        },
        edit: function () {

            Controller.api.valuechanged();


            //$(document).on("change", "#c-subsidies", function () {
            //    console.log('c-subsidies');
            //    Controller.api.valuechanged();
            //});

            $(document).on("change", ".valuechanged", function () {
                console.log('.valuechanged');
                Controller.api.valuechanged();
            });

            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            },
            defaultdate: function () {
                var date = new Date();
                var year = date.getFullYear();
                var month = date.getMonth() + 1;//获取当前月份(0-11,0代表1月)
                if (month >= 10) {
                    month = "" + month;
                } else {
                    month = "0" + month;
                }
                return year + "-" + month;
            },
            nextmonth: function (date) {

                if (date) {
                    date.setMonth(date.getMonth() + 1);

                    var year = date.getFullYear();
                    var month = date.getMonth() + 1;//获取当前月份(0-11,0代表1月)
                    if (month >= 10) {
                        month = "" + month;
                    } else {
                        month = "0" + month;
                    }
                    return year + "-" + month;
                }

                return "";
            },
            valuechanged: function () {

                var basewages = parseFloat($("#c-basewages").val());
                var bonuses = parseFloat($("#c-bonuses").val());
                var allowance = parseFloat($("#c-allowance").val());
                var overtimepay = parseFloat($("#c-overtimepay").val());
                var deductions = parseFloat($("#c-deductions").val());
                var totalwages = basewages + bonuses + allowance + overtimepay + deductions;
                totalwages = Controller.api.TransJine(totalwages);
                console.log(basewages + "+" + bonuses + "+" + allowance + "+" + overtimepay + "+" + deductions + "=" + totalwages);
                $("#c-totalwages").val(totalwages);


                var sbbase = parseFloat($("#c-sbbase").val());
                var gjjbase = parseFloat($("#c-gjjbase").val());

                //console.log(cdata.Xishu);
                //console.log(sbbase + " ~ " + cdata.Xishu[0]);

                var d_pension = Controller.api.TransJine(sbbase * cdata.Xishu[0]);
                $("#c-d_pension").val(d_pension);
                var d_yiliao = Controller.api.TransJine(sbbase * cdata.Xishu[1] + sbbase * cdata.Xishu[2]);
                $("#c-d_yiliao").val(d_yiliao);
                var d_shiye = Controller.api.TransJine(sbbase * cdata.Xishu[3]);
                $("#c-d_shiye").val(d_shiye);
                var d_shengyu = Controller.api.TransJine(sbbase * cdata.Xishu[4]);
                $("#c-d_shengyu").val(d_shengyu);
                var d_gongshang = Controller.api.TransJine(sbbase * cdata.Xishu[5]);
                $("#c-d_gongshang").val(d_gongshang);
                var d_chanbao = Controller.api.TransJine(sbbase * cdata.Xishu[6]);
                $("#c-d_chanbao").val(d_chanbao);
                var d_gjj = Controller.api.TransJine(sbbase * cdata.Xishu[7]);
                $("#c-d_gjj").val(d_gjj);
                var d_heji = Controller.api.TransJine(d_pension + d_yiliao + d_shiye + d_shengyu + d_gongshang + d_chanbao + d_gjj);
                $("#c-d_heji").val(d_heji);

                var s_pension = Controller.api.TransJine(sbbase * cdata.Xishu[8]);
                $("#c-s_pension").val(s_pension);
                var s_yiliao = Controller.api.TransJine(sbbase * cdata.Xishu[9]);
                $("#c-s_yiliao").val(s_yiliao);
                var s_shiye = Controller.api.TransJine(sbbase * cdata.Xishu[10]);
                $("#c-s_shiye").val(s_shiye);
                var s_gjj = Controller.api.TransJine(sbbase * cdata.Xishu[11]);
                $("#c-s_gjj").val(s_gjj);
                var s_heji = Controller.api.TransJine(s_pension + s_yiliao + d_shiye + s_gjj);
                $("#c-s_heji").val(s_heji);

                var y_wages = Controller.api.TransJine(totalwages - s_heji);
                $("#c-y_wages").val(y_wages);

                console.log(totalwages + " - " + s_heji + " = " + y_wages);

                var tax = Controller.api.TransGeshui(y_wages);
                $("#c-tax").val(tax);

                var r_wages1 = Controller.api.TransJine(y_wages - tax);
                $("#c-r_wages1").val(r_wages1);

                console.log(r_wages1 + "~r_wages1~" + $("#c-r_wages1").val());

                var subsidies = parseFloat($("#c-subsidies").val());
                var withholding = parseFloat($("#c-withholding").val());
                var r_wages2 = Controller.api.TransJine(r_wages1 + subsidies - withholding);
                $("#c-r_wages2").val(r_wages2);

                var managementfee = parseFloat($("#c-managementfee").val());
                var totalamount = Controller.api.TransJine(d_heji + s_heji + tax + r_wages2 + managementfee);
                $("#c-totalamount").val(totalamount);

                var year_end_award = parseFloat($("#c-year_end_award").val());
                var compensation = parseFloat($("#c-compensation").val());
                var totalamount_z = Controller.api.TransJine(totalamount + year_end_award + compensation);
                $("#c-totalamount_z").val(totalamount_z);


                function getuserinfo(idnumber) {
                    if (idnumber.length < 20 && Controller.api.validateIdCard(idnumber)) {
                        //http://dahui.test/api/dahui/getuserinfo?idnumber=130230198105213016
                        var url = '/api/dahui/getuserinfo?idnumber=' + idnumber;
                        Fast.api.ajax({
                            url: url
                        }, function (data, ret) {
                            console.log(data);
                            $("#c-name").val(data.name);
                            $("#c-mobile").val(data.mobile);
                            $("#c-address0").val(data.address0);
                            $("#c-address1").val(data.address1);
                            $("#c-name").val(data.name);
                            $("#c-idnumber").focusout();//移除焦点

                        });
                    }
                }

                document.getElementById('c-idnumber').addEventListener('paste', function (e) {
                    if (!(e.clipboardData && e.clipboardData.items)) {
                        return;
                    }
                    for (var i = 0, len = e.clipboardData.items.length; i < len; i++) {
                        var item = e.clipboardData.items[i];

                        if (item.kind === "string") {
                            item.getAsString(function (str) {
                                var idnumber = str.trim();
                                getuserinfo(idnumber);
                            })
                        } else if (item.kind === "file") {

                        }
                        break;
                    }
                });

                $("#c-idnumber").keypress(function (e) {
                    console.log("111");
                    if (e.which == 13) {
                        console.log("222");
                        var idnumber = $("#c-idnumber").val();
                        idnumber = idnumber.trim();
                        if (Controller.api.validateIdCard(idnumber))  {
                            getuserinfo(idnumber);
                        }
                    }
                });

                $(document).on("change", "#c-idnumber", function () {
                    console.log("555");
                    var idnumber = $("#c-idnumber").val();
                    idnumber = idnumber.trim();
                    if (Controller.api.validateIdCard(idnumber))  {
                        getuserinfo(idnumber);
                    }
                });


            },
            validateIdCard: function (idCard) {
                idCard = idCard.trim();
                var regIdCard = /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/;

                //如果通过该验证，说明身份证格式正确，但准确性还需计算
                if (regIdCard.test(idCard)) {
                    if (idCard.length == 18) {
                        var idCardWi = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2); //将前17位加权因子保存在数组里
                        var idCardY = new Array(1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2); //这是除以11后，可能产生的11位余数、验证码，也保存成数组
                        var idCardWiSum = 0; //用来保存前17位各自乖以加权因子后的总和
                        for (var i = 0; i < 17; i++) {
                            idCardWiSum += idCard.substring(i, i + 1) * idCardWi[i];
                        }
                        var idCardMod = idCardWiSum % 11;//计算出校验码所在数组的位置
                        var idCardLast = idCard.substring(17);//得到最后一位身份证号码
                        //如果等于2，则说明校验码是10，身份证号码最后一位应该是X
                        if (idCardMod == 2) {
                            if (idCardLast == "X" || idCardLast == "x") {
                                //alert("恭喜通过验证啦！");
                                return true;
                            } else {
                                //alert("身份证号码错误！");
                                Backend.api.toastr.error("身份证号码验证错误,请修改！");
                                return false;
                            }
                        } else {
                            //用计算出的验证码与最后一位身份证号码匹配，如果一致，说明通过，否则是无效的身份证号码
                            if (idCardLast == idCardY[idCardMod]) {
                                //alert("恭喜通过验证啦！");
                                return true;
                            } else {
                                //alert("身份证号码错误！");
                                Backend.api.toastr.error("身份证号码验证错误,请修改！");
                                return false;
                            }
                        }
                    }
                } else {
                    //alert("身份证格式不正确!");
                    Backend.api.toastr.error("身份证格式不正确!");
                    return false;
                }
            },
            TransJine: function (d) {
                return Math.round(d * 100) / 100;
            },
            TransGeshui: function (d) {
                d = d - 5000;
                if (d <= 0)
                    return 0;
                else if (d <= 3000)
                    return d * 0.03;
                else if (d <= 12000)
                    return d * 0.1 - 210;
                else if (d <= 25000)
                    return d * 0.2 - 1410;
                else if (d <= 35000)
                    return d * 0.25 - 2660;
                else if (d <= 55000)
                    return d * 0.3 - 4410;
                else if (d <= 80000)
                    return d * 0.35 - 7160;
                else
                    return d * 0.45 - 15160;
            },
            formatter: {//渲染的方法
                idnumber: function (value, row, index) {
                    return [
                        '<a href="javascript:;" class="aidnumber" data-id= "' + row.idnumber + '" > ' + row.idnumber + '</a>'
                    ].join("")
                },
                djstatus: function (value, row, index) {
                    if (row.paystatus == '未办理') {
                        return [
                            '<a href="javascript:;" class="djstatus text-danger" data-id= "' + row.id + '" > ' + row.paystatus + '</a>'
                        ].join("")

                    }  else {
                        return [
                            '<a href="javascript:;" class="djstatus" data-id= "' + row.id + '" > ' + row.paystatus + '</a>'
                        ].join("")
                    }
                }
            }
        }
    };
    return Controller;
});